package class_wuziqi;

import java.util.LinkedList;

public class Replay implements Runnable{
	private LinkedList<Chess> chesses=new LinkedList<Chess>();
	public Replay() {
		chesses=ChessArray.getInstance().chessList;
	}

	@Override
	public void run() {
		if(!chesses.isEmpty()){
		for(int i=0;i<chesses.size();i++){
			Chess chess=chesses.get(i);
			int a=chess.getI(),b=chess.getJ();
			ChessArray.arr[a][b]=chess;
			ChessBoard.getInstance().repaint();
//			ChessBoard.getInstance().setMessage(ChessBoard.getInstance().getMessage());
//			ChessBoard.getInstance().getGraphics().drawString(ChessBoard.getInstance().getMessage(), 0, 0);
			try {
				Thread.sleep(800);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	}
}
